# -*- coding: utf-8 -*-


from selenium.webdriver.common.by import By
from selenium import webdriver

driver = webdriver.Chrome()
driver.maximize_window()
driver.get('https://movie.douban.com/top250?&filter=')

# 获取属性 定位到这个标签， 通过get_attribute()
img_tag = driver.find_element(By.XPATH, '//div[@class="pic"]/a/img')
print(img_tag.get_attribute('src'))

# 文本
div_tag = driver.find_element(By.XPATH, '//div[@class="hd"]/a/span[1]')
print(div_tag.text)